package com.wilmer.stemCourse.service.impl;

import java.util.List;
import com.wilmer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.stemCourse.mapper.YwStemCourseMapper;
import com.wilmer.stemCourse.domain.YwStemCourse;
import com.wilmer.stemCourse.service.IYwStemCourseService;

/**
 * STEM课程Service业务层处理
 * 
 * @author zl
 * @date 2024-04-15
 */
@Service
public class YwStemCourseServiceImpl implements IYwStemCourseService 
{
    @Autowired
    private YwStemCourseMapper ywStemCourseMapper;

    /**
     * 查询STEM课程
     * 
     * @param courseId STEM课程主键
     * @return STEM课程
     */
    @Override
    public YwStemCourse selectYwStemCourseByCourseId(Long courseId)
    {
        return ywStemCourseMapper.selectYwStemCourseByCourseId(courseId);
    }

    /**
     * 查询STEM课程列表
     * 
     * @param ywStemCourse STEM课程
     * @return STEM课程
     */
    @Override
    public List<YwStemCourse> selectYwStemCourseList(YwStemCourse ywStemCourse)
    {
        return ywStemCourseMapper.selectYwStemCourseList(ywStemCourse);
    }

    /**
     * 新增STEM课程
     * 
     * @param ywStemCourse STEM课程
     * @return 结果
     */
    @Override
    public int insertYwStemCourse(YwStemCourse ywStemCourse)
    {
        ywStemCourse.setCreateTime(DateUtils.getNowDate());
        return ywStemCourseMapper.insertYwStemCourse(ywStemCourse);
    }

    /**
     * 修改STEM课程
     * 
     * @param ywStemCourse STEM课程
     * @return 结果
     */
    @Override
    public int updateYwStemCourse(YwStemCourse ywStemCourse)
    {
        ywStemCourse.setUpdateTime(DateUtils.getNowDate());
        return ywStemCourseMapper.updateYwStemCourse(ywStemCourse);
    }

    /**
     * 批量删除STEM课程
     * 
     * @param courseIds 需要删除的STEM课程主键
     * @return 结果
     */
    @Override
    public int deleteYwStemCourseByCourseIds(Long[] courseIds)
    {
        return ywStemCourseMapper.deleteYwStemCourseByCourseIds(courseIds);
    }

    /**
     * 删除STEM课程信息
     * 
     * @param courseId STEM课程主键
     * @return 结果
     */
    @Override
    public int deleteYwStemCourseByCourseId(Long courseId)
    {
        return ywStemCourseMapper.deleteYwStemCourseByCourseId(courseId);
    }
}
